<?php
	
namespace app\index\model;

use think\Model;

class User extends Model{
	/* protected $table = 'think_user';
	protected $type =[
				'birthday' => 'timestamp:Y/m/d',
	];
	//修改器
	protected function setBirthdarAttr($value){//
		return strtotime($value);
		
	}
	//读取器
	protected function getBirthdayAttr($birthday,$data){
		return date('Y-m-d',$data['birthday']);
	}
	*/
	//开启自动写入时间戳
	protected $autoWriteTimestamp = true;
	
	//定义自动完成属性
	protected $insert = ['status' => 1];
	
	//定义关联方法
	public function profile(){
			//用户has one 档案关联
			return $this->hasOne('Profile');
	}
	
}

?>